#include "stdafx.h"

#include "testVR.h"
void testVR::MFTEntry_data()
{
	QTest::addColumn<int>("mftNo");
	QTest::addColumn<QString>("mftName");
	QTest::newRow("all lower") << 5 << ".";
	QTest::newRow("all lower") << 1<< "$MFTMirr";
	QTest::newRow("all lower") << 2<< "$LogFile";
	QTest::newRow("all lower") << 3<< "$Volume";
	QTest::newRow("all lower") << 4<< "$AttrDef";
	QTest::newRow("all lower") << 5<< ".";
	QTest::newRow("all lower") << 6<< "$Bitmap";
	QTest::newRow("all lower") << 7<< "$Boot";
	QTest::newRow("all lower") << 8<< "$BadClus";
	QTest::newRow("all lower") << 9<< "$Secure";
	QTest::newRow("all lower") << 10<< "$UpCase";
	QTest::newRow("all lower") << 11<< "$Extend";


}

void testVR::MFTEntry()
{
	QFETCH(int, mftNo);
	QFETCH(QString, mftName);
	VolumeReader vr("\\\\.\\c:");
	QCOMPARE(vr.MFTEntry(mftNo).getFileName(),mftName);
	QCOMPARE(vr.MFTEntry(mftNo).entryNo(),(UINT64)mftNo);
	QCOMPARE(vr.isMFT(vr.MFTEntry(mftNo).diskOffSet),true);
	QCOMPARE(vr.MFTEntry(mftNo).isDeleted(),false);
	QCOMPARE(vr.MFTEntry(mftNo).hasExisted(),true);
	VolumeReader vr1("\\\\.\\e:");
	QCOMPARE(vr1.MFTEntry(mftNo).getFileName(),mftName);
	QCOMPARE(vr1.MFTEntry(mftNo).entryNo(),(UINT64)mftNo);
	QCOMPARE(vr1.isMFT(vr1.MFTEntry(mftNo).diskOffSet),true);

}